import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;

class Register extends StatelessWidget {
  bool _obscureText = true;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Column(
      children: [
        Expanded(
          child: ListView(
            children: [
              Stack(
                children: [
                  SafeArea(
                    top: false,
                    child: Image.asset(
                      'static/images/dengli.png',
                      fit: BoxFit.fitWidth,
                    ),
                  ),
                  Positioned(
                    bottom: 0,
                    right: 0,
                    left: 0,
                    child: Image.asset(
                      'static/images/loginimgb.png',
                      fit: BoxFit.fitWidth,
                    ),
                  ),
                  Positioned(
                    bottom: 20,
                    left: 60,
                    right: 60,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text('手机注册',
                            style: TextStyle(
                                fontSize: 18, color: Color(0XFF999999))),
                        Text('邮箱注册',
                            style: TextStyle(
                                fontSize: 18, color: Color(0XFF999999))),
                      ],
                    ),
                  ),
                ],
              ),
              Container(
                margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
                decoration: BoxDecoration(
                    border:
                        Border(bottom: BorderSide(color: Color(0XFFDDDDDD)))),
                child: Row(
                  children: [
                    SizedBox(
                      width: 15,
                    ),
                    Image.asset(
                      'static/images/guoqi.png',
                      fit: BoxFit.fitWidth,
                      width: 18,
                    ),
                    SizedBox(
                      width: 5,
                    ),
                    Text('+86', style: TextStyle(fontSize: 14)),
                    Expanded(
                        child: TextField(
                      style: TextStyle(fontSize: 14),
                      decoration: InputDecoration(
                        isCollapsed: true, //设置高度
                        contentPadding: EdgeInsets.all(15),
                        hintStyle: TextStyle(color: Color(0xff999999)),
                        border: InputBorder.none, // 隐藏输入框默认边框
                        hintText: '请输入手机号', // 提示文本
                      ),
                    ))
                  ],
                ),
              ),
              Container(
                  margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
                  decoration: BoxDecoration(
                      border:
                          Border(bottom: BorderSide(color: Color(0XFFDDDDDD)))),
                  child: Row(
                    children: [
                      Expanded(
                        child: TextField(
                          style: TextStyle(fontSize: 14),
                          decoration: InputDecoration(
                            isCollapsed: true, //设置高度
                            contentPadding: EdgeInsets.all(15),
                            hintStyle: TextStyle(color: Color(0xff999999)),
                            border: InputBorder.none, // 隐藏输入框默认边框
                            hintText: '请输入密码', // 提示文本
                          ),
                        ),
                      ),
                      Text('发送验证码',
                          style: TextStyle(
                              fontSize: 12, color: Color(0XFF0A72D9))),
                    ],
                  )),
              Container(
                  margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
                  decoration: BoxDecoration(
                      border:
                          Border(bottom: BorderSide(color: Color(0XFFDDDDDD)))),
                  child: TextField(
                    style: TextStyle(fontSize: 14),
                    decoration: InputDecoration(
                      suffixIcon: IconButton(
                        // 使用IconButton作为后缀图标按钮
                        icon: Icon(
                          size: 15,
                          _obscureText
                              ? Icons.visibility_off
                              : Icons.visibility, // 根据_obscureText的值切换图标
                        ),
                        onPressed: () {}, // 点击图标时调用_toggleVisibility方法
                      ),
                      isCollapsed: true, //设置高度
                      contentPadding: EdgeInsets.all(15),
                      hintStyle: TextStyle(color: Color(0xff999999)),
                      border: InputBorder.none, // 隐藏输入框默认边框
                      hintText: '请输入密码', // 提示文本
                    ),
                  )),
              Container(
                  margin: EdgeInsets.symmetric(horizontal: 30),
                  decoration: BoxDecoration(
                      border:
                          Border(bottom: BorderSide(color: Color(0XFFDDDDDD)))),
                  child: TextField(
                    style: TextStyle(fontSize: 14),
                    decoration: InputDecoration(
                      suffixIcon: IconButton(
                        // 使用IconButton作为后缀图标按钮
                        icon: Icon(
                          size: 15,
                          _obscureText
                              ? Icons.visibility_off
                              : Icons.visibility, // 根据_obscureText的值切换图标
                        ),
                        onPressed: () {}, // 点击图标时调用_toggleVisibility方法
                      ),
                      isCollapsed: true, //设置高度
                      contentPadding: EdgeInsets.all(15),
                      hintStyle: TextStyle(color: Color(0xff999999)),
                      border: InputBorder.none, // 隐藏输入框默认边框
                      hintText: '请输入确认密码', // 提示文本
                    ),
                  )),
              SizedBox(
                height: 20,
              ),
              Container(
                  margin: EdgeInsets.symmetric(horizontal: 40, vertical: 20),
                  height: 50,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular((50)),
                    gradient: LinearGradient(
                      colors: [
                        Color(0xff2189E7),
                        Color(0xffBF67F8),
                      ], // 定义颜色列表
                      begin: Alignment.topLeft, // 渐变开始的位置
                      end: Alignment.bottomRight, // 渐变结束的位置
                    ),
                  ),
                  child: Text('注 册',
                      style:
                          TextStyle(fontSize: 16, color: Color(0XFFFFFFFF)))),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Text('已有账户？请', style: TextStyle(fontSize: 12)),
                  Text('登录',
                      style: TextStyle(fontSize: 12, color: Color(0XFF0A72D9))),
                ],
              ),
              SizedBox(
                height: 30,
              ),
              Row(
                children: [
                  SizedBox(
                    width: 40,
                  ),
                  Expanded(
                    child: Divider(
                      color: Color(0XFFDDDDDD),
                    ),
                  ),
                  SizedBox(
                    width: 10,
                  ),
                  Text('或者', style: TextStyle(fontSize: 12)),
                  SizedBox(
                    width: 10,
                  ),
                  Expanded(
                    child: Divider(
                      color: Color(0XFFDDDDDD),
                    ),
                  ),
                  SizedBox(
                    width: 40,
                  ),
                ],
              ),
              Container(
                margin:
                    EdgeInsets.only(left: 100, right: 100, top: 30, bottom: 30),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Image.asset(
                      'static/images/weixin.png',
                      width: 40,
                      fit: BoxFit.fitWidth,
                    ),
                    Image.asset(
                      'static/images/pingguo.png',
                      width: 40,
                      fit: BoxFit.fitWidth,
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
        Row(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Transform.scale(
              scale: 0.7,
              child: Radio(
                  value: 1,
                  groupValue: 1,
                  onChanged: (v) => {},
                  activeColor: Color(0XFF0A72D9)),
            ),
            Text('已阅读并同意', style: TextStyle(fontSize: 11)),
            Text('《用户服务协议》',
                style: TextStyle(fontSize: 11, color: Color(0XFF0A72D9))),
            Text('与', style: TextStyle(fontSize: 11)),
            Text('《隐私权政策》',
                style: TextStyle(fontSize: 11, color: Color(0XFF0A72D9))),
          ],
        )
      ],
    ));
  }
}
